package com.herr.springboot.third.mail.controller;

import com.herr.springboot.third.mail.service.MailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import jakarta.mail.MessagingException;

/**
 * @author herr05
 */

@RestController
@RequestMapping("/mail")
public class MailController {

    @Autowired
    private MailService mailService;

    @RequestMapping("/send")
    public String send(){
        mailService.sendMail("herongrong-123@163.com","test","content");
        return "success";
    }

    @RequestMapping("/send2")
    public String send2() throws MessagingException {
        mailService.sendMail2("herongrong-123@163.com","test","content");
        return "success";
    }


    @RequestMapping("/send3")
    public String send3() throws MessagingException {
        mailService.sendMail3("herongrong-123@163.com","test");
        return "success";
    }

}
